﻿Imports BE.BE


Public Class frmReporteBitacora

#Region "Atributos"

    Public Ds As New DataSet
    Dim listabita As New List(Of Bitacora)

#End Region


#Region "Métodos"


    Private Sub frmReporteBitacora_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        For Each drow As DataRow In Ds.Tables(0).Rows
            Dim bita As New Bitacora
            bita.id_bitacora = drow.Item(0).ToString
            bita.id_usuario = drow.Item(1).ToString
            bita.fecha = drow.Item(3).ToString
            bita.usuario = drow.Item(2).ToString
            bita.descripcion = drow.Item(4).ToString
            bita.criticidad = drow.Item(5).ToString
            bita.borrado = drow.Item(6).ToString
            bita.dvh = drow.Item(7).ToString
            listabita.Add(bita)
        Next

        Me.ReportViewer1.LocalReport.ReportPath = "C:\Users\marcelo\Documents\Visual Studio 2012\Projects\SVN\SEAS\FL\Report1.rdlc"
        Me.BitacoraBindingSource.DataSource = listabita
        Me.ReportViewer1.RefreshReport() 'se add por el ReporteView1 automáticamente.

    End Sub


    Private Sub Cerrar_Click(sender As Object, e As EventArgs) Handles btnCerrar.Click
        Me.Close()
        Me.Dispose()
    End Sub


    Private Sub frmReporteBitacora_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.F1 Then
            Help.ShowHelp(Me, Application.StartupPath & "\ayuda_SEAS.chm", "ejemplobitacora.htm")
        End If
    End Sub


#End Region


End Class


#Region "Clase Auxiliar"

'creamos una clase que guardará la info de la bitacora (all strings).
Public Class Bitacora

    Dim mid_bitacora As Integer
    Dim mid_usuario As Integer
    Dim mfecha As String
    Dim musuario As String
    Dim mdescripcion As String
    Dim mcriticidad As String
    Dim mborrado As String
    Dim mdvh As String

    Public Property id_bitacora As Integer
        Get
            Return mid_bitacora
        End Get
        Set(value As Integer)
            mid_bitacora = value
        End Set
    End Property

    Public Property id_usuario As Integer
        Get
            Return mid_usuario
        End Get
        Set(value As Integer)
            mid_usuario = value
        End Set
    End Property

    Public Property fecha As String
        Get
            Return mfecha
        End Get
        Set(value As String)
            mfecha = value
        End Set
    End Property

    Public Property usuario As String
        Get
            Return musuario
        End Get
        Set(value As String)
            musuario = value
        End Set
    End Property

    Public Property descripcion As String
        Get
            Return mdescripcion
        End Get
        Set(value As String)
            mdescripcion = value
        End Set
    End Property

    Public Property criticidad As String
        Get
            Return mcriticidad
        End Get
        Set(value As String)
            mcriticidad = value
        End Set
    End Property

    Public Property borrado As String
        Get
            Return mborrado
        End Get
        Set(value As String)
            mborrado = value
        End Set
    End Property

    Public Property dvh As String
        Get
            Return mdvh
        End Get
        Set(value As String)
            mdvh = value
        End Set
    End Property


End Class


#End Region

